Skip to content

Conversation

@ma-kjh
Copy link
Contributor

@ma-kjh ma-kjh commented Nov 25, 2025

What does this PR do?

Problem

When evaluating models loaded in bfloat16 precision (e.g., Llama-3 on Ampere+ GPUs), avg_losses.cpu().numpy() fails with TypeError: Got unsupported ScalarType BFloat16 because NumPy does not support bfloat16 natively.

Solution

Explicitly cast the tensor to float32 using .float() before converting to NumPy in src/evals/metrics/utils.py.

Fixes # (issue)
N/A

Before submitting

  • This PR fixes a typo or improves the docs (you can dismiss the other checks if that's the case).
  • Have you gone through the contributions guide?
  • Are your changes documented? Read documentation guidelines here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant